package com.hello.service;

import com.hello.constant.PasswordConstant;
import com.hello.constant.StatusConstant;
import com.hello.context.BaseContext;
import com.hello.dto.EmployeeDTO;
import com.hello.dto.PetcardDTO;
import com.hello.entity.Employee;
import com.hello.entity.Petcard;
import com.hello.mapper.PetcardMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.time.LocalDateTime;

@Service
public class PetcardService {

    @Autowired
    PetcardMapper petcardMapper;

    /**
     * 新增宠物卡
     * @param petcardDTO
     */
    public void save(PetcardDTO petcardDTO) {
        System.out.println("当前线程的id：" + Thread.currentThread().getId());
        Petcard petcard = new Petcard();

        //对象属性拷贝
        BeanUtils.copyProperties(petcardDTO,petcard);


        petcardMapper.insert(petcard);
    }
}
